package com.zhao.concreteCommand;

import com.zhao.command.Command;
import com.zhao.other.Order;
import com.zhao.receiver.SeniorChef;

import java.util.Set;

public class OrderCommand implements Command {

    private SeniorChef receiver;

    private Order order;

    public OrderCommand(SeniorChef receiver, Order order) {
        this.receiver = receiver;
        this.order = order;
    }


    @Override
    public void execute() {
        System.out.println(order.getDiningTable() + "卓的订单：");
        Set<String> foodNames = order.getFoodDic().keySet();
        for (String foodName : foodNames) {
            receiver.makeFood(order.getFoodDic().get(foodName), foodName);
        }
    }
}
